package net.jalisq.types;

import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;

public abstract class DerivedColumnAdapter<Type> extends Column {

	private List<IColumn> phCols;// = new LinkedList<IColumn<Type>>();

	public DerivedColumnAdapter(String repr, Class<Type> type, IColumn... cols) {
		super(repr, type);
		phCols = Arrays.asList(cols);
	}

	public List<IColumn> getInvolvedColumns() {
		return Collections.unmodifiableList(phCols);
	}

	public List<Table> getInvolvedTables() {
		List<Table> tables = new LinkedList<Table>();
		for (IColumn<Type> col : phCols) {
			tables.addAll(col.getInvolvedTables());
		}
		return tables;
	}
}
